<?php
/**
 * Created by PhpStorm.
 * Author: Shadow
 * Date: 2021/12/20
 * Time: 4:03 下午
 * description: api.php
 */

use think\facade\Route;
use think\middleware\Throttle;

/**
 * 登录路由
 */
Route::get('getCaptcha',"login/getCaptcha")->allowCrossDomain();
Route::post('login',"login/login")->allowCrossDomain();
Route::get('logout',"login/logout")->allowCrossDomain();
//Route::get('findRole',"login/findRole")->allowCrossDomain();

/**
 * 商品有关路由配置
 */
Route::group('goods',function (){
    Route::resource('goods','goods');
    Route::resource('brand','brand');
    Route::resource('category','category');
    Route::get('export','goods/export');
    Route::resource('type','type');

})->middleware(\app\adminapi\middleware\Login::class)->allowCrossDomain();
Route::get('xss','goods/xss');
/**
 * 后台用户有关接口
 */
Route::group('admin',function (){
    Route::resource('admin','admin');
})->middleware(\app\adminapi\middleware\Login::class)->allowCrossDomain();

/**
 * 后台权限有关接口
 */
Route::group('auth',function (){
    Route::resource('auth','auth');
})->middleware(\app\adminapi\middleware\Login::class)->allowCrossDomain();

/**
 * 图片相关
 */
Route::group(function (){
    Route::post('singleUpload',"Image/singleUpload");
    Route::post('multiUpload',"Image/multiUpload");
})->middleware(\app\adminapi\middleware\Login::class)->allowCrossDomain();